home *** CD-ROM | disk | other *** search
/ SGI Hot Mix 8 / Hot Mix 8.iso / .all / demos / MorfDMG / RemoveIt2 (.txt) < prev   
Text File  |  1994-06-22  |  2KB  |  76 lines

  1. #!/bin/csh -f
  2.  
  3. #  This script will remove the INST_PATH directory created by the
  4. #  InstallIt2 script.
  5. #  Determine INST_PATH from the HOTMIXPATH* file.
  6. #
  7. #  First, try /usr/tmp.  If not there, try the user's home directory,
  8. #  and finally, /tmp.  If not in any of these places, ask for the
  9. #  name of the path.  If the user doesn't know (or forgets) where
  10. #  the software was installed, we're SOL.  Remove the file after
  11. #  using it.
  12. set INST_DIR=iii
  13. set INST_PATH=/usr/local/$INST_DIR
  14.         echo " "
  15.         echo "About to remove the entire $INST_PATH directory."
  16.         echo "Is this OK (y/n)?  \c"
  17.         set ans=($<)
  18.         if ( $ans == 'y' ) then
  19.             echo " "
  20.             echo "Removing $INST_PATH.  Please wait..."
  21.  
  22.             /bin/rm -rf $INST_PATH
  23.             /bin/rm /usr/lib/X11/app-defaults/Morf
  24.     
  25.             echo " "
  26.             echo "Removal complete."
  27.             sleep 3
  28.             echo "Press Enter to exit this window...  \c"
  29.             set a = $<
  30.             exit
  31.         else 
  32.             echo "... Bye."
  33.             sleep 3
  34.             exit
  35.         endif
  36.  
  37.     else
  38.         echo " "
  39.         echo "You do not have permission to remove the $INST_PATH directory."
  40.         echo "If you are SURE you want to remove this, you will be asked"
  41.         echo "for the root password before proceeding."
  42.         echo " "
  43.         echo "Continue (y/n)?  \c"
  44.         set ans=($<)
  45.         if ( $ans == 'y' ) then
  46.             echo " "
  47.             echo "Removing $INST_PATH.  Please wait..."
  48.  
  49.             su - root -c "/bin/rm -rf $INST_PATH"
  50.         /bin/rm /usr/lib/X11/app-defaults/Morf
  51.             echo " "
  52.             echo "Removal complete."
  53.         echo "Press Enter to exit this window...  \c"
  54.               set a = $<
  55.  
  56.         else
  57.             echo " "
  58.             echo "... Bye."
  59.             sleep 3
  60.         endif
  61.     endif
  62. else
  63.         echo " "
  64.         echo "Could not find the $INST_PATH directory.  Please try again."
  65.         echo " "
  66.         echo "... Bye."
  67.         /bin/rm -f /usr/tmp/HOTMIXPATH_$INST_DIR > /dev/null
  68.         /bin/rm -f ~/HOTMIXPATH_$INST_DIR > /dev/null
  69.         /bin/rm -f /tmp/HOTMIXPATH_$INST_DIR > /dev/null
  70.         sleep 10
  71. endif
  72.     echo "Press Enter to exit this window...  \c"
  73.     set a = $<
  74.  
  75. exit 0
  76.